// To parse this JSON data, do
//
//     final squareImageModel = squareImageModelFromJson(jsonString);

import 'dart:convert';

SquareImageModel squareImageModelFromJson(String str) => SquareImageModel.fromJson(json.decode(str));

String squareImageModelToJson(SquareImageModel data) => json.encode(data.toJson());


class  SquareImageListModel {
  List<SquareImageModel> list;
   SquareImageListModel(this.list);

  factory  SquareImageListModel.fromJson(List<dynamic> list) {
    // 调用自身构造方法传值并返回
    return  SquareImageListModel(
      list.map((listItem) => SquareImageModel.fromJson(listItem)).toList(),
    );
  }
}

class SquareImageModel {
    SquareImageModel({
        this.id,
        this.momentId,
        this.url,
        this.width,
        this.height,
        this.artistId,
        this.createTime,
        this.updateTime,
    });

    int id;
    int momentId;
    String url;
    int width;
    int height;
    int artistId;
    DateTime createTime;
    DateTime updateTime;

    factory SquareImageModel.fromJson(Map<String, dynamic> json) => SquareImageModel(
        id: json["id"],
        momentId: json["momentId"],
        url: json["url"],
        width: json["width"],
        height: json["height"],
        artistId: json["artistId"],
        createTime: DateTime.parse(json["createTime"]),
        updateTime: DateTime.parse(json["updateTime"]),
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "momentId": momentId,
        "url": url,
        "width": width,
        "height": height,
        "artistId": artistId,
        "createTime": createTime.toIso8601String(),
        "updateTime": updateTime.toIso8601String(),
    };
}
